﻿<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="generator" content="Jekyll v3.6.0">
<title>Router路由支持 &middot; BootstrapVue</title>
<!-- Bootstrap 核心CSS -->
<link href="../../../v4/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- 本文档额外专用css -->
<link href="../../../v4/assets/css/docsearch.min.css" rel="stylesheet">
<link href="../../../v4/assets/css/docs.min.css" rel="stylesheet">
<link href="../../style/bv_path.css" rel="stylesheet">

<!-- Favicons图标定义 -->
<link data-n-head="ssr" rel="manifest" href="../../manifest.json">
<link data-n-head="ssr" rel="shortcut icon" href="../../style/icons/icon_64.png">
<link data-n-head="ssr" rel="apple-touch-icon" href="../../style/icons/icon_512.png" sizes="512x512">

<!-- Meta关键字定义 -->
<meta name="description" content="The most popular HTML, CSS, and JS library in the world.">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">

</head>
<body>
<a id="skippy" class="sr-only sr-only-focusable" href="#content">
<div class="container"> <span class="skiplink-text">跳到主体内容</span> </div>
</a>
<header class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar"> <a class="navbar-brand mr-0 mr-md-2" href="../" aria-label="Bootstrap">
  <svg class="d-block" width="36" height="36" viewbox="0 0 612 612" xmlns="http://www.w3.org/2000/svg" focusable="false">
    <title>Bootstrap</title>
    <path fill="currentColor" d="M510 8a94.3 94.3 0 0 1 94 94v408a94.3 94.3 0 0 1-94 94H102a94.3 94.3 0 0 1-94-94V102a94.3 94.3 0 0 1 94-94h408m0-8H102C45.9 0 0 45.9 0 102v408c0 56.1 45.9 102 102 102h408c56.1 0 102-45.9 102-102V102C612 45.9 566.1 0 510 0z"/>
    <path fill="currentColor" d="M196.77 471.5V154.43h124.15c54.27 0 91 31.64 91 79.1 0 33-24.17 63.72-54.71 69.21v1.76c43.07 5.49 70.75 35.82 70.75 78 0 55.81-40 89-107.45 89zm39.55-180.4h63.28c46.8 0 72.29-18.68 72.29-53 0-31.42-21.53-48.78-60-48.78h-75.57zm78.22 145.46c47.68 0 72.73-19.34 72.73-56s-25.93-55.37-76.46-55.37h-74.49v111.4z"/>
  </svg>
  </a>
  <div class="navbar-nav-scroll">
    <ul class="navbar-nav bd-navbar-nav flex-row">
      <li class="nav-item"><a class="nav-link " href="../">首页</a></li>
      <li class="nav-item"><a class="nav-link " href="index.html">中文手册</a></li>
      <li class="nav-item"><a class="nav-link " href="../components">组件</a></li>
      <li class="nav-item"><a class="nav-link " href="../directives">指令</a></li>
      <li class="nav-item"><a class="nav-link active" href="../reference">参考</a></li>
      <li class="nav-item"><a class="nav-link " href="https://bootstrap-vue.org/play" target="_blank">体验</a></li>
      <li class="nav-item"><a class="nav-link " href="http://code.z01.com/v4"><i class="zi zi_bold" zico="粗"></i> Boostrap</a></li>
      <li class="nav-item"><a class="nav-link" href="http://ico.z01.com" target="_blank" rel="noopener">zico图标系统</a></li>
      <li class="nav-item"><a class="nav-link" href="http://www.z01.com" target="_blank" rel="noopener">Zoomla!逐浪CMS</a></li>
    </ul>
  </div>
  <ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">
    <li class="nav-item dropdown"> <a class="nav-item nav-link dropdown-toggle mr-md-2" href="#" id="bd-versions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="alse"> v2.12.0 </a>
      <div class="dropdown-menu dropdown-menu-right" aria-labelledby="bd-versions"> 
        <a class="dropdown-item active" href="../../../bootstrap-vue/docs/4.0/">Latest (4.3.x)</a>
        <a class="dropdown-item" href="/Boot/">v3.3.7</a>
        <a class="dropdown-item" href="/Sass/">Sass语言</a>
        <a class="dropdown-item" href="/Emmet/">Emmet语法</a>
        <a class="dropdown-item" href="//www.z01.com/tool/" target="_blank">IIS站长工具</a>
        <a class="dropdown-item" href="//ad.z01.com/" target="_blank">广告源码</a>
        <a class="dropdown-item" href="//v.z01.com/mb/" target="_blank">免费模板</a>
        <a class="dropdown-item" href="//v.z01.com/" target="_blank">H5移动创作</a>
        <a class="dropdown-item" href="//www.z01.com/help/web/3234.shtml" target="_blank">Flexbox布局</a>
		<a class="dropdown-item" href="/boot/font.html" target="_blank">Font Awesome</a>
</div>
    </li>
    <li class="nav-item"> <a class="nav-link p-2" href="//zoomla.github.io/bootstrap4-zhcn-documentation" target="_blank" rel="noopener" aria-label="GitHub">
      <svg class="navbar-nav-svg" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 499.36" focusable="false">
        <title>GitHub</title>
        <path d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z" fill="currentColor" fill-rule="evenodd"/>
      </svg>
      </a> </li>
    <li class="nav-item"> <a class="nav-link p-2" href="http://www.z01.com/blog/ren/3214.shtml" target="_blank" rel="noopener" aria-label="Slack">译者说</a></li>
  </ul>
  <a class="btn btn-bd-yellow d-none d-lg-inline-block mb-3 mb-md-0 ml-md-3" href="download.html">下载 Bootstrap</a> </header>

<div class="container-fluid">
  <div class="row flex-xl-nowrap">
    <div class="col-12 col-md-3 col-xl-2 bd-sidebar">
      <form class="bd-search d-flex align-items-center">
        <input type="search" class="form-control" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
        <button class="btn btn-link bd-search-docs-toggle d-md-none p-0 ml-3" type="button" data-toggle="collapse" data-target="#bd-docs-nav" aria-controls="bd-docs-nav" aria-expanded="false" aria-label="Toggle docs navigation">
        <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 30 30" width="30" height="30" focusable="false">
          <title>Menu</title>
          <path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M4 7h22M4 15h22M4 23h22"/>
        </svg>
        </button>
      </form>


<nav class="collapse bd-links" id="bd-docs-nav">
<div class=""><a href="../" class="bd-toc-link">首页</a></div>
<div class="bd-toc-item nuxt-link-exact-active "><a href="../../../bootstrap-vue/docs/" class="bd-toc-link  "> 起步 </a>
<ul class="nav bd-sidenav">
</ul>
</div>
<div class="bd-toc-item"><a href="../../../bootstrap-vue/docs/components/" class="bd-toc-link nuxt-link-exact-active"> 组件 </a>
<ul class="nav bd-sidenav">
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/index.html" class="nav-link"> 组件目录 </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/alert.html" class="nav-link"> 警告提示框(Alert) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/badge.html" class="nav-link"> 徽章(Badge) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/badge.html" class="nav-link"> 面包屑导航(Breadcrumb) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/button.html" class="nav-link"> 按钮(Button) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/button-group.html" class="nav-link"> 按钮组(Button Group) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/button-toolbar.html" class="nav-link"> 按钮Toolbar(Button Toolbar) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/calendar.html" class="nav-link"> 日历组件(Calendar) <small class="badge text-uppercase badge-success">New</small> </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/card.html" class="nav-link"> 卡片(Card) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/carousel.html" class="nav-link"> 轮播效果(Carousel) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/collapse.html" class="nav-link"> 折叠面板(Collapse) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/dropdown.html" class="nav-link"> 下拉菜单(Dropdown) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/embed.html" class="nav-link"> 嵌入(Embed) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form.html" class="nav-link"> 表单(Form) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-checkbox.html" class="nav-link"> 表单复选框(Form Checkbox) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-datepicker.html" class="nav-link"> 表单时间选择器(Form Datepicker) <small class="badge text-uppercase badge-success">New</small> </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-file.html" class="nav-link"> 文件选择(Form File) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-group.html" class="nav-link"> 表单组合(Form Group) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-input.html" class="nav-link"> 表单输入框(Form Input) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-radio.html" class="nav-link"> 单选择表单Form Radio </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-select.html" class="nav-link"> 下拉式表单(Form Select) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-spinbutton.html" class="nav-link"> 按钮式表单(Form Spinbuttno) <small class="badge text-uppercase badge-success">New</small> </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-tags.html" class="nav-link"> Tags表单选择器(Form Tags) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-textarea.html" class="nav-link"> 文本框(Form Textarea) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/form-timepicker.html" class="nav-link"> 表单内时间控件(Form Timepicker) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/image.html" class="nav-link"> 图片(Image) </a></li>

<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/input-group.html" class="nav-link"> 输入框(Input Group) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/jumbotron.html" class="nav-link"> Hero大块屏(Jumbotron) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/layout.html" class="nav-link"> 布局与网络Layout and Grid System </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/link.html" class="nav-link"> 链接(Link)</a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/list-group.html" class="nav-link"> 列表组(List group) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/media.html" class="nav-link"> 媒体(Media) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/modal.html" class="nav-link"> 弹出模态框(Modal) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/nav.html" class="nav-link"> 导航(Nav) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/navbar.html" class="nav-link"> 导航栏(Navbar) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/pagination.html" class="nav-link"> 分页(Pagination) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/pagination-nav.html" class="nav-link"> 分页导航(Pagination Nav) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/popover.html" class="nav-link"> 指示备注(Popover) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/progress.html" class="nav-link"> 进度指示器(Progress) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/spinner.html" class="nav-link"> 旋转指示器(Spinner) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/table.html" class="nav-link"> 表格(Table) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/tabs.html" class="nav-link"> 选项卡(Tabs) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/time.html" class="nav-link"> 时间组件(Time) </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/components/toast.html" class="nav-link"> 冒泡推送(Toasts) </a></li>
<li class="nav-item active"><a href="../../../bootstrap-vue/docs/components/tooltip.html" class="nav-link"> tip提示组件(Tooltip) </a></li>
</ul>
</div>
<div class="bd-toc-item"><a href="../../../bootstrap-vue/docs/directives/" class="bd-toc-link"> 指令 </a>
<ul class="nav bd-sidenav">
<li class="nav-item active"><a href="../../../bootstrap-vue/docs/directives/index.html" class="nav-link"> 指令目录 </a></li>
<li class="nav-item active"><a href="../../../bootstrap-vue/docs/directives/hover.html" class="nav-link"> Hover 指令<small class="badge text-uppercase badge-success">New</small> </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/directives/popover.html" class="nav-link"> Popover 提示备注</a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/directives/scrollspy.html" class="nav-link"> Scrollspy 滚动监听</a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/directives/tooltip.html" class="nav-link"> Tooltip 提示指令</a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/directives/visible.html" class="nav-link"> Visible 可见性操作<small class="badge text-uppercase badge-success">New</small> </a></li>
</ul>
</div>
<div class="bd-toc-item"><a href="../../../bootstrap-vue/docs/icons.html" class="bd-toc-link"> Icons图标</a>
<ul class="nav bd-sidenav">
</ul>
</div>
  
<div class="bd-toc-item active"> <a class="bd-toc-link" href="../../../bootstrap-vue/docs/reference">参考 </a>
<ul class="nav bd-sidenav">
<li class="nav-item"><a href="../../../bootstrap-vue/docs/reference" class="nav-link"> 参考目录 </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/reference/accessibility.html" class="nav-link">友好访问</a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/reference/color-variants.html" class="nav-link">Color颜色变量 </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/reference/images.html" class="nav-link"> 组件图像img的src路径解析</a></li>
<li class="nav-item active"><a href="../../../bootstrap-vue/docs/reference/router-links.html" class="nav-link"> Router路由支持 </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/reference/size-props.html" class="nav-link">大小规格</a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/reference/spacing-classes.html" class="nav-link">间距处理</a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/reference/starter-templates.html" class="nav-link">开始模板</a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/reference/theming.html" class="nav-link">主题色彩</a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/reference/utility-classes.html" class="nav-link">通用Class类</a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/reference/validation.html" class="nav-link">Form表单验证</a></li>
</ul>
</div>
<div class="bd-toc-item"> <a class="bd-toc-link" href="../components/alerts.html"> 杂项 </a>
<ul class="nav bd-sidenav">
<li class="nav-item"><a href="../../../bootstrap-vue/docs/misc/changelog.html" class="nav-link"> Changelog </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/misc/contributing.html" class="nav-link"> Contributing </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/misc/settings.html" class="nav-link"> Settings </a></li>
<li class="nav-item"><a href="../../../bootstrap-vue/docs/misc/third-party.html" class="nav-link"> Third party libraries </a></li>
</ul>
</div>
<div class=""><a href="/play" class="bd-toc-link">在线模拟器</a></div>
</nav>
</div>

<div class="d-none d-xl-block col-xl-2 bd-toc">
<ul class="section-nav">
<li class="nav-item toc-entry mb-2"><a target="_self" href="#router-link-support" class="nav-link font-weight-bold"><span>Router 路由支持</span></a></li>
<li class="nav-item toc-entry toc-h2 mb-1"><a target="_self" href="#common-router-link-props" class="nav-link"><span>通用路由器链接属性</span></a>
<ul class="nav flex-column">
<li class="nav-item toc-entry toc-h3"><a target="_self" href="#to" class="nav-link"><span>to</span></a></li>
<li class="nav-item toc-entry toc-h3"><a target="_self" href="#replace" class="nav-link"><span>replace</span></a></li>
<li class="nav-item toc-entry toc-h3"><a target="_self" href="#append" class="nav-link"><span>append</span></a></li>
<li class="nav-item toc-entry toc-h3"><a target="_self" href="#router-tag" class="nav-link"><span>router 标签</span></a></li>
<li class="nav-item toc-entry toc-h3"><a target="_self" href="#active-class" class="nav-link"><span>active 类</span></a></li>
<li class="nav-item toc-entry toc-h3"><a target="_self" href="#exact" class="nav-link"><span>exact</span></a></li>
<li class="nav-item toc-entry toc-h3"><a target="_self" href="#exact-active-class" class="nav-link"><span>exact-active 类</span></a></li>
</ul>
</li>
<li class="nav-item toc-entry toc-h2 mb-1"><a target="_self" href="#nuxtjs-specific-router-link-props" class="nav-link"><span>Nuxt.js特定的路由器链接属性</span></a>
<ul class="nav flex-column">
<li class="nav-item toc-entry toc-h3"><a target="_self" href="#no-prefetch" class="nav-link"><span>no-prefetch</span></a></li>
</ul>
</li>
</ul>
</div>

<main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content" role="main">


<div class="bv-ad"><script id="_carbonads_js" async="async" type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CE7ITK77&amp;placement=bootstrap-vuejsorg"></script>
<div id="carbonads"><span><span class="carbon-wrap"><a href="https://srv.carbonads.net/ads/click/x/GTND42QYCKSD42QMC6ALYKQMFT7IPKJECKAIKZ3JCWADC2QIFTYDLK3KC6BIEK7NCWBDVK3EHJNCLSIZ?segment=placement:bootstrap-vuejsorg;" class="carbon-img" target="_blank" rel="noopener sponsored"><img src="https://cdn4.buysellads.net/uu/1/56866/1574258644-20191120_Octopus_Product.png" alt="ads via Carbon" border="0" style="max-width: 130px;"></a><a href="https://srv.carbonads.net/ads/click/x/GTND42QYCKSD42QMC6ALYKQMFT7IPKJECKAIKZ3JCWADC2QIFTYDLK3KC6BIEK7NCWBDVK3EHJNCLSIZ?segment=placement:bootstrap-vuejsorg;" class="carbon-text" target="_blank" rel="noopener sponsored">
  给您的团队一个发布，</br>部署和操作软件的地方。</a></span><a href="http://carbonads.net/?utm_source=bootstrap-vuejsorg&amp;utm_medium=ad_via_link&amp;utm_campaign=in_unit&amp;utm_term=carbon" class="carbon-poweredby" target="_blank" rel="noopener sponsored">ads via Carbon</a></span></div>
</div>
<nav class="bd-quick-links mb-3 d-xl-none" style="" data-v-4abf2740="">
<header data-v-4abf2740="">
<button data-v-4abf2740="" type="button" class="btn font-weight-bold btn-outline-secondary btn-sm btn-block collapsed" aria-controls="bd-quick-links-collapse" aria-expanded="false"> Show page table of contents </button>
</header>
<ul data-v-4abf2740="" id="bd-quick-links-collapse" class="collapse" style="display: none;">
<li data-v-4abf2740=""><a data-v-4abf2740="" target="_self" href="#common-router-link-props" class=""><span data-v-4abf2740="">Common router link props</span></a>
<ul data-v-4abf2740="">
<li data-v-4abf2740=""><a data-v-4abf2740="" target="_self" href="#to" class=""><span data-v-4abf2740="">to</span></a></li>
<li data-v-4abf2740=""><a data-v-4abf2740="" target="_self" href="#replace" class=""><span data-v-4abf2740="">replace</span></a></li>
<li data-v-4abf2740=""><a data-v-4abf2740="" target="_self" href="#append" class=""><span data-v-4abf2740="">append</span></a></li>
<li data-v-4abf2740=""><a data-v-4abf2740="" target="_self" href="#router-tag" class=""><span data-v-4abf2740="">router-tag</span></a></li>
<li data-v-4abf2740=""><a data-v-4abf2740="" target="_self" href="#active-class" class=""><span data-v-4abf2740="">active-class</span></a></li>
<li data-v-4abf2740=""><a data-v-4abf2740="" target="_self" href="#exact" class=""><span data-v-4abf2740="">exact</span></a></li>
<li data-v-4abf2740=""><a data-v-4abf2740="" target="_self" href="#exact-active-class" class=""><span data-v-4abf2740="">exact-active-class</span></a></li>
</ul>
</li>
<li data-v-4abf2740=""><a data-v-4abf2740="" target="_self" href="#nuxtjs-specific-router-link-props" class=""><span data-v-4abf2740="">Nuxt.js specific router link props</span></a>
<ul data-v-4abf2740="">
<li data-v-4abf2740=""><a data-v-4abf2740="" target="_self" href="#no-prefetch" class=""><span data-v-4abf2740="">no-prefetch</span></a></li>
</ul>
</li>
</ul>
</nav>
<h2 id="common-router-link-props" class="bv-no-focus-ring"><span class="bd-content-title">通用路由器链接属性<a class="anchorjs-link" href="#common-router-link-props" aria-labelledby="common-router-link-props"></a></span></h2>
<p>
  在下面的部分中，我们将使用<code class="text-nowrap" translate="no">&lt;b-link&gt;</code>组件来呈现路由器链接。
  <code class="text-nowrap" translate="no">&lt;b-link&gt;</code>是大多数BootstrapVue可操作组件的构建块。您可以使用支持链接生成的任何其他组件，
  如<a href="/docs/components/link" class="font-weight-bold"><code class="text-nowrap" translate="no">&lt;b-link&gt;</code></a>, 
  <a href="/docs/components/button" class="font-weight-bold"><code class="text-nowrap" translate="no">&lt;b-button&gt;</code></a>, 
  <a href="/docs/components/breadcrumb" class="font-weight-bold"><code class="text-nowrap" translate="no">&lt;b-breadcrumb-item&gt;</code></a>, 
  <a href="/docs/components/list-group" class="font-weight-bold"><code class="text-nowrap" translate="no">&lt;b-list-group-item&gt;</code></a>, 
  <a href="/docs/components/nav" class="font-weight-bold"><code class="text-nowrap" translate="no">&lt;b-nav-item&gt;</code></a>, 
  <a href="/docs/components/dropdown" class="font-weight-bold"><code class="text-nowrap" translate="no">&lt;b-dropdown-item&gt;</code></a>,和
   <a href="/docs/components/pagination-nav" class="font-weight-bold"><code class="text-nowrap" translate="no">&lt;b-pagination-nav&gt;</code></a>。请注意，
   并非所有组件上都有可用的属性。有关详细信息，请参阅相应的组件文档。
</p>
<h3 id="to" class="bv-no-focus-ring"><span class="bd-content-title"><code class="text-nowrap" translate="no">to</code><a class="anchorjs-link" href="#to" aria-labelledby="to"></a></span></h3>
<ul>
<li>类型: <code class="text-nowrap" translate="no">string | Location</code></li>
<li>需要生成一个 <code class="text-nowrap" translate="no">&lt;router-link&gt;</code></li>
</ul>
<p>
  表示链接的目标路由。单击时，<code class="text-nowrap" translate="no">to</code>属性的值将在内部传递给<code class="text-nowrap" translate="no">router.push()</code>，因此该值可以是字符串或位置描述符对象。
</p>
<div class="bd-code">
<pre class="hljs html p-2" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-comment">&lt;!-- Literal string --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">to</span>=<span class="hljs-string">"home"</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>
  <span class="hljs-comment">&lt;!-- Renders to --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"home"</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- JavaScript expression using `v-bind` --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">v-bind:to</span>=<span class="hljs-string">"'home'"</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- Omitting `v-bind` is fine, just as binding any other prop --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">:to</span>=<span class="hljs-string">"'home'"</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- Same as above --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">:to</span>=<span class="hljs-string">"{ path: 'home' }"</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- Named route --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">:to</span>=<span class="hljs-string">"{ name: 'user', params: { userId: 123 } }"</span>&gt;</span>User<span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- With query, resulting in `/register?plan=private` --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">:to</span>=<span class="hljs-string">"{ path: 'register', query: { plan: 'private' } }"</span>&gt;</span>Register<span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- Render a non-router link by omitting `to` and specifying an `href` --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/home"</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></pre>
</div>
<h3 id="replace" class="bv-no-focus-ring"><span class="bd-content-title"><code class="text-nowrap" translate="no">replace</code><a class="anchorjs-link" href="#replace" aria-labelledby="replace"></a></span></h3>
<ul>
<li>类型: <code class="text-nowrap" translate="no">boolean</code></li>
<li>默认值: <code class="text-nowrap" translate="no">false</code></li>
</ul>
<p>
  设置<code class="text-nowrap" translate="no">replace</code>属性将在单击时调用<code class="text-nowrap" translate="no">router.replace()</code>而不是
  <code class="text-nowrap" translate="no">router.push()</code>，因此导航不会留下历史记录。
</p>
<div class="bd-code">
<pre class="hljs html p-2" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">:to</span>=<span class="hljs-string">"{ path: '/abc'}"</span> <span class="hljs-attr">replace</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></pre>
</div>
<h3 id="append" class="bv-no-focus-ring"><span class="bd-content-title"><code class="text-nowrap" translate="no">append</code><a class="anchorjs-link" href="#append" aria-labelledby="append"></a></span></h3>
<ul>
<li>类型: <code class="text-nowrap" translate="no">boolean</code></li>
<li>默认值: <code class="text-nowrap" translate="no">false</code></li>
</ul>
<p>
  设置<code class="text-nowrap" translate="no">append</code>属性总是将相对路径附加到当前路径。例如，假设我们从<code class="text-nowrap" translate="no">/a</code>导航到一个相对链接<code class="text-nowrap" translate="no">b</code>，
  没有<code class="text-nowrap" translate="no">append</code>，我们将在<code class="text-nowrap" translate="no">/b</code>结束，但是有<code class="text-nowrap" translate="no">append</code>，
  我们将在<code class="text-nowrap" translate="no">/a/b</code>结束。
</p>
<div class="bd-code">
<pre class="hljs html p-2" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">:to</span>=<span class="hljs-string">"{ path: 'relative/path'}"</span> <span class="hljs-attr">append</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></pre>
</div>
<h3 id="router-tag" class="bv-no-focus-ring"><span class="bd-content-title"><code class="text-nowrap" translate="no">router 标签</code><a class="anchorjs-link" href="#router-tag" aria-labelledby="router-tag"></a></span></h3>
<ul>
<li>类型: <code class="text-nowrap" translate="no">string</code></li>
<li>默认值: <code class="text-nowrap" translate="no">'a'</code></li>
</ul>
<p>
  有时我们希望<code class="text-nowrap" translate="no">&lt;router-link&gt;</code>呈现为另一个标签，例如<code class="text-nowrap" translate="no">&lt;li&gt;</code>。 
  然后，我们可以使用<code class="text-nowrap" translate="no">router-tag</code>属性指定要渲染到的标签，它仍将监听单击事件以进行导航。
  <code class="text-nowrap" translate="no">router-tag</code>转换为最终呈现的<code class="text-nowrap" translate="no">&lt;router-link&gt;</code>
  上的<code class="text-nowrap" translate="no">标签</code>属性。
</p>
<div class="bd-code">
<pre class="hljs html p-2" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">to</span>=<span class="hljs-string">"/foo"</span> <span class="hljs-attr">router-tag</span>=<span class="hljs-string">"li"</span>&gt;</span>foo<span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>

  <span class="hljs-comment">&lt;!-- Renders as --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">li</span>&gt;</span>foo<span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></pre>
</div>
<p><strong>注意:</strong> 
  不建议从<code class="text-nowrap" translate="no">&lt;a&gt;</code>之外的其他任何地方更改标签，因为这会妨碍键盘和/或屏幕阅读器用户的可访问性，并且也不是非常适合SEO。
</p>
<h3 id="active-class" class="bv-no-focus-ring"><span class="bd-content-title"><code class="text-nowrap" translate="no">active 类</code><a class="anchorjs-link" href="#active-class" aria-labelledby="active-class"></a></span></h3>
<ul>
<li>类型: <code class="text-nowrap" translate="no">string</code></li>
<li>默认值: <code class="text-nowrap" translate="no">'router-link-active'</code> (使用Nuxt.js时为<code class="text-nowrap" translate="no">'nuxt-link-active'</code>)</li>
</ul>
<p>
  配置链接处于active状态时应用的activeCSS类。注意，默认值也可以通过<code class="text-nowrap" translate="no">linkActiveClass</code> 
  <a href="https://router.vuejs.org/api/#linkactiveclass" target="_blank" rel="noopener">路由器构造函数选项</a>进行全局配置。
</p>
<p>
  对于支持路由器链接（有<code class="text-nowrap" translate="no">to</code>属性）的组件，
  您需要将其设置为类<code class="text-nowrap" translate="no">'active'</code>（或包含<code class="text-nowrap" translate="no">'active'</code>的空格分隔字符串），以便在当前路由与to prop匹配时在组件上应用Bootstrap的active样式。
</p>
<h3 id="exact" class="bv-no-focus-ring"><span class="bd-content-title"><code class="text-nowrap" translate="no">exact</code><a class="anchorjs-link" href="#exact" aria-labelledby="exact"></a></span></h3>
<ul>
<li>类型: <code class="text-nowrap" translate="no">boolean</code></li>
<li>默认值: <code class="text-nowrap" translate="no">false</code></li>
</ul>
<p>
  默认的活动类匹配行为是<strong>inclusive match</strong>。例如，<code class="text-nowrap" translate="no">&lt;b-link to="/a"&gt;</code>将应用该类，
  只要当前路径以<code class="text-nowrap" translate="no">/a/</code>或is <code class="text-nowrap" translate="no">/a</code>开头。
</p>
<p>
  这样的结果是，<code class="text-nowrap" translate="no">&lt;b-link to="/"&gt;</code>将对每条路线都有效！ 要将链接强制为“完全匹配模式”，
  请使用<code class="text-nowrap" translate="no">exact</code>的属性：
</p>
<div class="bd-code">
<pre class="hljs html p-2" translate="no"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-comment">&lt;!-- This link will only be active at `/` --&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">b-link</span> <span class="hljs-attr">to</span>=<span class="hljs-string">"/"</span> <span class="hljs-attr">exact</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">b-link</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></pre>
</div>
<p>
  查看更多解释active链接类<a href="https://jsfiddle.net/8xrk1n9f/" target="_blank" rel="noopener">live</a>的示例。
</p>
<h3 id="exact-active-class" class="bv-no-focus-ring"><span class="bd-content-title"><code class="text-nowrap" translate="no">exact-active 类</code><a class="anchorjs-link" href="#exact-active-class" aria-labelledby="exact-active-class"></a></span></h3>
<ul>
<li>类型: <code class="text-nowrap" translate="no">string</code></li>
<li>默认值: <code class="text-nowrap" translate="no">'router-link-exact-active'</code> (使用Nuxt.js时<code class="text-nowrap" translate="no">'nuxt-link-exact-active'</code>)</li>
<li>可用性: Vue Router 2.5.0+</li>
</ul>
<p>
  配置具有完全匹配的活动链接时应用的活动CSS类。 注意，默认值也可以通过<code class="text-nowrap" translate="no">linkExactActiveClass</code> 
  <a href="https://router.vuejs.org/api/#linkexactactiveclass" target="_blank" rel="noopener">路由器构造函数选项</a>进行全局配置。
</p>
<p>
  对于支持路由器链接（有<code class="text-nowrap" translate="no">to</code>属性）的组件，
  您需要将其设置为类<code class="text-nowrap" translate="no">'active'</code>（或包含<code class="text-nowrap" translate="no">'active'</code>的空格分隔字符串），
  以便在当前路由与<code class="text-nowrap" translate="no">to</code>属性匹配时在组件上应用Bootstrap的active样式。
</p>
<h2 id="nuxtjs-specific-router-link-props" class="bv-no-focus-ring"><span class="bd-content-title">Nuxt.js特定的路由器链接属性<a class="anchorjs-link" href="#nuxtjs-specific-router-link-props" aria-labelledby="nuxtjs-specific-router-link-props"></a></span></h2>
<p>
  当BootstrapVue检测到您的应用程序正在<a href="https://nuxtjs.org" target="_blank" rel="noopener">Nuxt.js</a>下运行时，
  它将呈现一个<a href="https://nuxtjs.org/api/components-nuxt-link" target="_blank" rel="noopener"><code class="text-nowrap" translate="no">&lt;nuxt-link&gt;</code></a>子组件，
  而不是一个<code class="text-nowrap" translate="no">&lt;router-link&gt;</code>。
  <code class="text-nowrap" translate="no">&lt;nuxt-link&gt;</code>支持上述所有路由器链接属性，以及以下特定于nuxt.js的附加属性。
</p>
<h3 id="no-prefetch" class="bv-no-focus-ring"><span class="bd-content-title"><code class="text-nowrap" translate="no">no-prefetch</code><a class="anchorjs-link" href="#no-prefetch" aria-labelledby="no-prefetch"></a></span></h3>
<ul>
<li>类型: <code class="text-nowrap" translate="no">boolean</code></li>
<li>默认值: <code class="text-nowrap" translate="no">false</code></li>
<li>可用性: Nuxt.js 2.4.0+</li>
</ul>
<p>
  为了提高Nuxt.js应用程序的响应能力，当链接显示在视区内时，Nuxt.js将自动prefetch代码分割的页面。不设置<code class="text-nowrap" translate="no">no-prefetch</code>将禁用特定链接的此功能。
</p>
<p><strong>注意:</strong> 
  如果您在 <code class="text-nowrap" translate="no">nuxt.config.js</code>配置中禁用了prefetch
  （<code class="text-nowrap" translate="no">router: { prefetchLinks: false}</code>），
  或者正在使用nuxt.js<code class="text-nowrap" translate="no">&lt; 2.4.0</code>的版本，则此属性将无效。
</p>
<p>Prefetch支持要求支持<a href="https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API" target="_blank" rel="noopener">IntersectionObserver</a>
  （请参阅<a href="https://caniuse.com/#feat=intersectionobserver" target="_blank" rel="noopener">CanIUse</a>）。
  对于不支持IntersectionObserver的浏览器，可以在<code class="text-nowrap" translate="no">nuxt.config.js</code>中使用以下条件polyfill：
</p>
<div class="bd-code">
<pre class="hljs js p-2" translate="no"><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
  <span class="hljs-attr">head</span>: {
    <span class="hljs-attr">script</span>: [
      {
        <span class="hljs-attr">src</span>: <span class="hljs-string">'https://polyfill.io/v3/polyfill.min.js?features=es2015%2CIntersectionObserver'</span>,
        <span class="hljs-attr">body</span>: <span class="hljs-literal">true</span>
      }
    ]
  }
}</pre>
</div>





</main>
</div>
</div>


<script src="../../../js/jquery-3.2.1.slim.min.js"></script> 
<script>window.jQuery || document.write('<script src="../assets/js/vendor/jquery-slim.min.js"><\/script>')</script> 
<script src="../../../v4/dist/js/popper.min.js"></script> 
<script src="../../../v4/dist/js/bootstrap.min.js"></script> 
<script src="../../../v4/assets/js/docs.min.js"></script> 
<script src="../../../v4/assets/js/ie-emulation-modes-warning.js"></script> 
<script src="../../../v4/assets/js/docsearch.min.js"></script> 
<script>
  docsearch({
    appId: 'PRR89ISST8',
    apiKey: '95044d57d4d7bb744f322d1f18ed607f',
    indexName: 'z01-bootstrapV4',
    inputSelector: '#search-input',
    handleSelected: function (input, event, suggestion) {
      var url = suggestion.url;
      url = suggestion.isLvl1 ? url.split('#')[0]: url;
      // If it's a title we remove the anchor so it does not jump.
      window.location.href = url;
    },
    transformData: function (hits) {
      return hits.map(function (hit) {
        hit.url = hit.url.replace('https://v4-alpha.getbootstrap.com', '/docs/4.0');
        return hit;
      });
    },
    debug: false // Set debug to true if you want to inspect the dropdown
  });
</script> 
<script>
  Holder.addTheme('gray', {
    bg: '#777',
    fg: 'rgba(255,255,255,.75)',
    font: 'Helvetica',
    fontweight: 'normal'
  });
</script>
</body>
</html>
